package com.blame.onlinemusicserver.mapper;
import com.blame.onlinemusicserver.model.Music;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface LoveMusicMapper {


    //检查该音乐是否已经被收藏
    Music selectMusicIsExist(Integer userId,Integer musicId);

    //将该音乐加入收藏夹

    Boolean insertLoveMusic(Integer userId,Integer musicId);

    //将该音乐从收藏夹中删除

    Boolean deleteLoveMusic(Integer userId,Integer musicId);

    //根据用户信息查询收藏的歌曲，支持模糊查询
    List<Music> findLoveMusicByUserId(Integer userId);


    //根据用户信息来查询想要查询的收藏的歌曲
    List<Music> findLoveMusicByUserIdAndMusicId(Integer userId,String musicName);

    Boolean deleteLoveMusicByMusicId(Integer musicId);

    Boolean selectLoveMusicByMusicId(Integer musicId);
}
